import Vue from 'vue'
import Router from 'vue-router'

// in development-env not use lazy-loading, because lazy-loading too many pages will cause webpack hot update too slow. so only in production use lazy-loading;
// detail: https://panjiachen.github.io/vue-element-admin-site/#/lazy-loading

Vue.use(Router)

/* Layout */
import Layout from '../views/layout/Layout'


/**
* hidden: true                   if `hidden:true` will not show in the sidebar(default is false)
* alwaysShow: true               if set true, will always show the root menu, whatever its child routes length
*                                if not set alwaysShow, only more than one route under the children
*                                it will becomes nested mode, otherwise not show the root menu
* redirect: noredirect           if `redirect:noredirect` will no redirect in the breadcrumb
* name:'router-name'             the name is used by <keep-alive> (must set!!!)
* meta : {
    title: 'title'               the name show in submenu and breadcrumb (recommend set)
    icon: 'svg-name'             the icon show in the sidebar
    breadcrumb: false            if false, the item will hidden in breadcrumb(default is true)
  }
**/
export var constantRouterMap = [
  
  { path: '/login', component: () => import('@/views/login/index'), hidden: true },
  { path: '/wxlogin', component: () => import('@/views/login/wxlogin'), hidden: true },
  
  
  {
    path: '',
    component: Layout,
    redirect: '/dashboard',
    hidden: true,
    children: [{
      path: 'dashboard',
      component: () => import('@/views/dashboard/index'),
      name: 'Dashboard',
      meta: { title: '首页', icon: 'dashboard'}
    }]
  },
  { path: '/404', component: () => import('@/views/404'), hidden: true },
 /* {
    path: '/infoManagement',
    component: Layout,
    redirect: '/infoManagement/information',
    name: 'Account',
    meta: { title: '信息管理', icon: 'zhanghu' },
    children: [
			{
			  path: 'informationCat',
			  name: 'informationCat',
			  component: () => import('@/views/infoManagement/informationCat'),
			  meta: { title: '资讯分类' }
			},
      {
        path: 'newsInfo',
        name: 'newsInfo',
        component: () => import('@/views/infoManagement/information'),
        meta: { title: '资讯管理' }
      },
			{
			    path: 'productInfoCat',
			    name: 'productInfoCat',
			    component: () => import('@/views/infoManagement/productInfoCat'),
			    meta: { title: '产品分类管理' }
			},
      {
          path: 'productInfo',
          name: 'productInfo',
          component: () => import('@/views/infoManagement/productInfo'),
          meta: { title: '产品管理' }
      },
			{
			    path: 'solutionInfoCat',
			    name: 'solutionInfoCat',
			    component: () => import('@/views/infoManagement/solutionInfoCat'),
			    meta: { title: '解决方案分类管理' }
			}, 
       {
          path: 'solutionInfo',
          name: 'solutionInfo',
          component: () => import('@/views/infoManagement/solutionInfo'),
          meta: { title: '解决方案管理' }
      }, 
    ]
  },

  {
    path: '/advertisement',
    component: Layout,
    redirect: '/advertisement/index',
    name: 'Company',
    meta: { title: '广告管理', icon: 'slide' },
    children:[
      {
        path: 'slide',
        name: 'slide',
        component: () => import('@/views/advertisement/slide'),
        meta: { title: '轮播图管理' }
      },
    ]
  }, 
  {
    path: '/friendShipLink',
    component: Layout,
    redirect: '/friendShipLink/index',
    name: 'Company',
    meta: { title: '友情链接', icon: 'flink' },
    children:[
      {
        path: 'slide',
        name: 'slide',
        component: () => import('@/views/friendLink/friendLink'),
        meta: { title: '友情链接' }
      },
    ]
  }, */

 

/*  {
    path: '/message',
    component: Layout,
    redirect: '/message/message',
    name: 'News',
    meta: { title: '消息中心', icon: 'xiaoxi2' },
    children:[
     {
        path: 'message',
        name: 'message',
        component: () => import('@/views/message/message'),
        meta: { title: '消息中心' }
      },
    ]
  }, */

 // { path: '*', redirect: '/404', hidden: true }
]


export default new Router({
  //mode: 'history', //后端支持可开
  scrollBehavior: () => ({ y: 0 }),
 routes: constantRouterMap
})


